package com.sgame.android;

//import com.sgame.android.Mobage.ServerMode;


public enum ServerMode
{
	UNKNOWN,SANDBOX, PRODUCTION, STAGING, DEVELOPMENT;
  
	private String name;
	private String socialServerUrl;
	private String bankServerUrl;
	private String assetsServerUrl;
	private String webviewUrl;

	public static ServerMode fromInt(int value)
	{
      if(value == SANDBOX.ordinal())
          return SANDBOX;
      if(value == PRODUCTION.ordinal())
          return PRODUCTION;
      if(value == STAGING.ordinal() - 1)
          return STAGING;
      if(value == DEVELOPMENT.ordinal() - 1)
          return DEVELOPMENT;
      else
      {
          MLog.w("Mobage", (new StringBuilder()).append("unknown server mode:").append(Integer.toString(value)).toString());
          return UNKNOWN;
      }
	}

	public int toInt()
	{
      switch(ordinal())
      {
      case 1: // '\001'
          return 0;

      case 2: // '\002'
          return 1;

      case 3: // '\003'
          return 2;

      case 4: // '\004'
          return 3;

      case 5: // '\005'
          return 4;

      case 6: // '\006'
          return 5;
      }
      return -1;
	}

  public void setData(String name, String socialServerUrl, String bankServerUrl, String assetsServerUrl, String webviewUrl)
  {
    this.name = name;
    this.socialServerUrl = socialServerUrl;
    this.bankServerUrl = bankServerUrl;
    this.assetsServerUrl = assetsServerUrl;
    this.webviewUrl = webviewUrl;
  }

  public final String getSocialServerUrl()
  {
    return this.socialServerUrl;
  }

  public final String getBankServerUrl()
  {
    return this.bankServerUrl;
  }

  public final String getAssetsServerUrl()
  {
    return this.assetsServerUrl;
  }

  public final String getWebviewUrl()
  {
    return this.webviewUrl;
  }
}
